package 从身份证获取生日日期;

import java.util.Scanner;

public class birthday {//123456 7891 0121 3141
    public static void main(String[]args){
        Scanner id=new Scanner(System.in);
        System.out.println("请输入身份证号：");
        String a=id.next();
        String Y=a.substring(6,10);
        String M=a.substring(10,12);
        String D=a.substring(12,14);
        String sex=a.substring(16,17);
        int x=Integer.parseInt(sex);
        String c;
        if (x%2==0)c="女";
        else c="男";
        System.out.println("生日为："+Y+"年"+M+"月"+D+"日"+c);
    }
}
